/**
 * Copyright (C) 2010 Krishna Sundaresan <calvinkrishy@gmail.com>
 *      
 * This file is part of webos-datecalculator application.
 * 
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 * 
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License for more details.
 * 
 * You should have received a copy of the GNU Lesser General Public License
 * along with this program. If not, see <http://www.gnu.org/licenses/>.
 */

function DateCalculatorModels(sceneName){

    this.sceneName = sceneName
    
    this.getAppMenuModel = function(){
    
        var appMenu = {
            items: [{}, {
                label: $L('About'),
                command: 'abt-scene'
            }, {
                label: $L('Help'),
                command: 'help-scene'
            }, ]
        }
        
        if ('interval-diff' == this.sceneName) {
            appMenu.items[0] = {
                label: $L('Find & Remind'),
                command: 'first'
            }
        }
        else {
            appMenu.items[0] = {
                label: $L('Find Interval'),
                command: 'interval-diff'
            }
        }
        
        return appMenu
        
    }
    
    this.getViewMenuModel = function(){
    
        var viewMenuModel = {
            visible: true,
            items: [{
                label: $L('Calculator Views'),
                items: [{
                    label: $L('Find & Remind'),
                    command: 'first',
                    width: 160
                }, {
                    label: $L('Find Interval'),
                    command: 'interval-diff',
                    width: 160
                }],
                toggleCmd: this.sceneName
            }]
        }
        
        return viewMenuModel
        
    }
    
}

DateCalculatorModels.menuAttrs = {
    omitDefaultItems: true
}

DateCalculatorModels.dayModel = {
    "alarm": "none",
    "choices": [{
        label: "No reminder",
        value: "none"
    }, {
        label: $L("1 day earlier"),
        value: "-P1D"
    }, {
        label: $L("2 days earlier"),
        value: "-P2D"
    }, {
        label: $L("1 week earlier"),
        value: "-P7D"
    }]
}

DateCalculatorModels.weekModel = {
    "alarm": "none",
    "choices": [{
        label: $L("No reminder"),
        value: "none"
    }, {
        label: $L("15 min earlier"),
        value: "-PT15M"
    }, {
        label: $L("30 min earlier"),
        value: "-PT30M"
    }, {
        label: $L("1 hour earlier"),
        value: "-PT1H"
    }]
}

